package org.asociacion.backend.bo;

import java.util.HashSet;
import java.util.Set;

import org.asociacion.backend.persistence.entities.TblCity;
import org.asociacion.backend.persistence.entities.TblState;

public class StateBo {
	
	private Integer id;
	private String name;
	private Set<String> setCity;
	
	{
		setCity = new HashSet<String>();
	}
	
	public StateBo() {
	}

	public StateBo(TblState tblState) {
		id = tblState.getId();
		name = tblState.getName();
		for (TblCity tblCity : tblState.getSetTblCity()) {
			setCity.add(tblCity.getName());
		}
	}
	
	@Override
	public String toString() {
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.append("id: ").append(id).append(" name: ").append(name);
		for (String city : setCity) {
			stringBuilder.append(" city: ").append(city);
		}
		return stringBuilder.toString();
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
